#demo.py
# for i in range(10):
	# if i == 4:
		# break
	# if i > 5 and i < 8:
		# continue
	# print i

i=0
sum=0
# while (i < 10):
	# i=i+1
	# sum=sum+i
for i in range(101):
	sum=sum+i

print sum

>>> def welcome(who, state='is', action='sleeping'):
	print who,state,action

	
>>> welcome('Jim','was')
Jim was sleeping
>>> welcome('Jim', action='thinking')
Jim is thinking
>>> def foo():
	print "hello"

	
>>> foo()
hello
>>> def foo(str):
	print str

	
>>> foo("hello")
hello
>>> def foo(str,str2):
	print str,str2

	
>>> foo("hello","world")
hello world
>>> def foo(str,str2=123):
	print str,str2

	
>>> foo("hello","world")
hello world
>>> def welcome(*arg):
	print arg

	
>>> welcome("hello","world")
('hello', 'world')
>>> def welcome(**arg):
	print arg

	
>>> welcome(name='itercast',age=1)
{'age': 1, 'name': 'itercast'}

#学习类的使用
class Monk:
	def __init__(self, name, age):
		self.name = name
		self.age = age
		
	def net(self):
		print "I love zhangyu"
		
	def play(self, str):
		print "play with", str
		
m1 = Monk("yixiu",8)
print m1.name
m1.net()
m1.play("compute")

